package com.example.pipibee.dao.repository.imp;

import com.example.pipibee.dao.mapper.DoctorMapper;
import com.example.pipibee.dao.repository.DoctorRepository;
import com.example.pipibee.pojo.param.*;
import com.example.pipibee.pojo.vo.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Slf4j
@Repository
public class DoctorRepositoryImp implements DoctorRepository {

    @Autowired
    DoctorMapper doctorMapper;

    @Override
    public int insertMrin(DoctorInsertParam doctorInsertParam) {
        log.debug("开始执行【插入_住院病案_主表】的数据访问，参数：{}", doctorInsertParam);
        return doctorMapper.insertMrin(doctorInsertParam);
    }

    @Override
    public int insertDia(DoctorDiaInsertParam doctorDiaInsertParam) {
        log.debug("开始执行【插入_住院病案_诊断表】的数据访问，参数：{}", doctorDiaInsertParam);
        return doctorMapper.insertDia(doctorDiaInsertParam);
    }

    @Override
    public int insertSur(DoctorSurInsertParam doctorSurInsertParam) {
        log.debug("开始执行【插入_住院病案_手术表】的数据访问，参数：{}", doctorSurInsertParam);
        return doctorMapper.insertSur(doctorSurInsertParam);
    }

    @Override
    public int deleteDia(DoctorDiaDeleteParam doctorDiaDeleteParam) {
        log.debug("开始执行【批量删除_住院病案_诊断表】的数据访问，参数：{}", doctorDiaDeleteParam);
        return doctorMapper.deleteDia(doctorDiaDeleteParam);
    }

    @Override
    public int deleteSur(DoctorSurDeleteParam doctorSurDeleteParam) {
        log.debug("开始执行【批量删除_住院病案_手术表】的数据访问，参数：{}", doctorSurDeleteParam);
        return doctorMapper.deleteSur(doctorSurDeleteParam);
    }

    @Override
    public int deleteAllMrin(DoctorDeleteAllMrinParam doctorDeleteAllMrinParam) {
        log.debug("开始执行【ALL删除_住院病案_主表】的数据访问，参数：{}", doctorDeleteAllMrinParam);
        return doctorMapper.deleteAllMrin(doctorDeleteAllMrinParam);
    }

    @Override
    public int deleteAllDia(DoctorDeleteAllDiaParam doctorDeleteAllDiaParam) {
        log.debug("开始执行【ALL删除_住院病案_诊断表】的数据访问，参数：{}", doctorDeleteAllDiaParam);
        return doctorMapper.deleteAllDia(doctorDeleteAllDiaParam);
    }

    @Override
    public int deleteAllSur(DoctorDeleteAllSurParam doctorDeleteAllSurParam) {
        log.debug("开始执行【ALL删除_住院病案_手术表】的数据访问，参数：{}", doctorDeleteAllSurParam);
        return doctorMapper.deleteAllSur(doctorDeleteAllSurParam);
    }

    @Override
    public int updateMrin(DoctorUpdateMrinParam doctorUpdateMrinParam) {
        log.debug("开始执行【修改_住院病案_主表】的数据访问，参数：{}", doctorUpdateMrinParam);
        return doctorMapper.updateMrin(doctorUpdateMrinParam);
    }

    @Override
    public int updateDia(DoctorDiaUpdateParam doctorDiaUpdateParam) {
        log.debug("开始执行【修改_诊断表】的数据访问，参数：{}", doctorDiaUpdateParam);
        return doctorMapper.updateDia(doctorDiaUpdateParam);
    }

    @Override
    public int updateSur(DoctorSurUpdateParam doctorSurUpdateParam) {
        log.debug("开始执行【修改_手术表】的数据访问，参数：{}", doctorSurUpdateParam);
        return doctorMapper.updateSur(doctorSurUpdateParam);
    }

    @Override
    public int discharge(DoctorDischargeParam doctorDischargeParam) {
        log.debug("开始执行【批量出院】的数据访问，参数：{}", doctorDischargeParam);
        return doctorMapper.discharge(doctorDischargeParam);
    }

    @Override
    public int submit(DoctorSubmitParam2 doctorSubmitParam2) {
        log.debug("开始执行【医生端_提交病案】的数据访问，参数：{}", doctorSubmitParam2);
        return doctorMapper.submit(doctorSubmitParam2);
    }

    @Override
    public int approval(DoctorApprovalParam2 doctorApprovalParam2) {
        log.debug("开始执行【病案室_审批】的数据访问，参数：{}", doctorApprovalParam2);
        return doctorMapper.approval(doctorApprovalParam2);
    }

    @Override
    public int lookAppByMrNum(Long mrNum) {
        log.debug("开始执行【根据病案号查询病案装态】的数据访问，参数：{}", mrNum);
        return doctorMapper.lookAppByMrNum(mrNum);
    }

    @Override
    public DoctorSurUpdateSelectVO updateSurSelect(DoctorSurUpdateSelectParam doctorSurUpdateSelectParam) {
        log.debug("开始执行【查询填充_手术表】的数据访问，参数：{}", doctorSurUpdateSelectParam);
        return doctorMapper.updateSurSelect(doctorSurUpdateSelectParam);
    }

    @Override
    public DoctorDiaUpdateSelectVO updateDiaSelect(DoctorDiaUpdateSelectParam doctorDiaUpdateSelectParam) {
        log.debug("开始执行【查询填充_诊断表】的数据访问，参数：{}", doctorDiaUpdateSelectParam);
        return doctorMapper.updateDiaSelect(doctorDiaUpdateSelectParam);
    }

    @Override
    public int diaLooker(String mrInId) {
        log.debug("开始执行【根据住院病案ID查询主要诊断个数】的数据访问，参数：{}", mrInId);
        return doctorMapper.diaLooker(mrInId);
    }

    @Override
    public int surLooker(String mrInId) {
        log.debug("开始执行【根据住院病案ID查询主要手术个数】的数据访问，参数：{}", mrInId);
        return doctorMapper.surLooker(mrInId);
    }

    @Override
    public int mrinLooker(String id) {
        log.debug("开始执行【根据ID查询住院病案是否存在】的数据访问，参数：{}", id);
        return doctorMapper.mrinLooker(id);
    }

    @Override
    public List<DoctorListSelectVO> list(DoctorListSelectParam doctorListSelectParam) {
        log.debug("开始执行【分页模糊查询病案列表】的数据访问，参数：{}", doctorListSelectParam);
        return doctorMapper.list(doctorListSelectParam);
    }

    @Override
    public Long count(DoctorListSelectParam doctorListSelectParam) {
        log.debug("开始执行【分页模糊查询病案列表_总条数】的数据访问，参数：{}", doctorListSelectParam);
        return doctorMapper.count(doctorListSelectParam);
    }

    @Override
    public String selectIdByMrNum(Long mrNum) {
        log.debug("开始执行【根据住院号查询住院病案ID】的数据访问，参数：{}", mrNum);
        return doctorMapper.selectIdByMrNum(mrNum);
    }

    @Override
    public DoctorSelectMrinVO selectMrinById(String id) {
        log.debug("开始执行【根据住院病案ID查询住院病案_主表_基本信息】的数据访问，参数：{}", id);
        return doctorMapper.selectMrinById(id);
    }

    @Override
    public List<DoctorSelectDiaVO> selectDiaById(String mrInId) {
        log.debug("开始执行【根据住院病案ID查询住院病案_诊断表】的数据访问，参数：{}", mrInId);
        return doctorMapper.selectDiaById(mrInId);
    }

    @Override
    public List<DoctorSelectSurVO> selectSurById(String mrInId) {
        log.debug("开始执行【根据住院病案ID查询住院病案_手术表】的数据访问，参数：{}", mrInId);
        return doctorMapper.selectSurById(mrInId);
    }


}
